Repository navigation
Add Block-Jacobi preconditioning and optimize matrix-free Schur - #51
Open
zitongzhan wants to merge 2 commits into
Open
zitongzhan wants to merge 2 commits into
zitongzhan wants to merge 2 commits into
Conversation
…olves - Add BlockJacobiPCG, a PCG subclass whose preconditioner for warp BSR systems inverts the diagonal blocks instead of warp's scalar Jacobi. Schur uses the solver's preconditioner when it provides one. - Matrix-free Schur now preconditions with the block diagonal of the Schur complement S = U - W V^-1 W^T, computed per observation by a warp kernel, instead of with U. - Convert the assembled Jacobian CSR in LM.step to int32 indices when they fit (COO -> CSR widens them to int64). - NormalMatVec: precompute damping * diag in set_damping so matvec has no host sync, fuse the damping term with addcmul_, and return a copy from diagonal() since PCG modifies it in place. On BAL Ladybug-1723 (20 LM steps, RTX 3080), matrix-free Schur with BlockJacobiPCG runs in 2.75 s vs 2.83 s, and explicit Schur in 8.1 s vs 12.4 s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The matrix-free branch of Schur.step now keeps the transposed Jacobians built for U and V and uses plain bsr_mv on them for the J^T products. Warp's bsr_mv(..., transpose=True) scatters with atomics and is several times slower (J0^T product 530 us -> 212 us on Ladybug-1723). One Schur matvec: 0.93 ms -> 0.60 ms; 20 LM steps with BlockJacobiPCG: 2.75 s -> 2.16 s at the same loss. Warp pool peak +~40 MiB (the transposes now live through the solve); torch peak unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.